/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.cepre.model;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Elvis Zangetsu
 */
@Entity
@Table(name = "detalleperiodopagos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Detalleperiodopagos.findAll", query = "SELECT d FROM Detalleperiodopagos d"),
    @NamedQuery(name = "Detalleperiodopagos.findByIdDetallePeriodoPagos", query = "SELECT d FROM Detalleperiodopagos d WHERE d.idDetallePeriodoPagos = :idDetallePeriodoPagos"),
    @NamedQuery(name = "Detalleperiodopagos.findByIdPeriodo", query = "SELECT d FROM Detalleperiodopagos d WHERE d.idPeriodo = :idPeriodo")})
public class Detalleperiodopagos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idDetallePeriodoPagos")
    private String idDetallePeriodoPagos;
    @Column(name = "idPeriodo")
    private String idPeriodo;
    @JoinColumn(name = "idPagos", referencedColumnName = "idPagos")
    @ManyToOne
    private Pagos idPagos;

    public Detalleperiodopagos() {
    }

    public Detalleperiodopagos(String idDetallePeriodoPagos) {
        this.idDetallePeriodoPagos = idDetallePeriodoPagos;
    }

    public String getIdDetallePeriodoPagos() {
        return idDetallePeriodoPagos;
    }

    public void setIdDetallePeriodoPagos(String idDetallePeriodoPagos) {
        this.idDetallePeriodoPagos = idDetallePeriodoPagos;
    }

    public String getIdPeriodo() {
        return idPeriodo;
    }

    public void setIdPeriodo(String idPeriodo) {
        this.idPeriodo = idPeriodo;
    }

    public Pagos getIdPagos() {
        return idPagos;
    }

    public void setIdPagos(Pagos idPagos) {
        this.idPagos = idPagos;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetallePeriodoPagos != null ? idDetallePeriodoPagos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Detalleperiodopagos)) {
            return false;
        }
        Detalleperiodopagos other = (Detalleperiodopagos) object;
        if ((this.idDetallePeriodoPagos == null && other.idDetallePeriodoPagos != null) || (this.idDetallePeriodoPagos != null && !this.idDetallePeriodoPagos.equals(other.idDetallePeriodoPagos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upeu.cepre.model.Detalleperiodopagos[ idDetallePeriodoPagos=" + idDetallePeriodoPagos + " ]";
    }
    
}
